package com.bigcms.service.impl;

import com.bigcms.domain.User;
import com.bigcms.mapper.UserMapper;
import com.bigcms.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private  UserMapper userMapper;

    @Override
    public int addUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public User getUser(String mobile) {
        return userMapper.findUserByLogin(mobile);
    }

    @Override
    public User getUser(int id) {
        return userMapper.findUserById(id);
    }

    @Override
    public int editUser(User user) {
        return userMapper.updateUser(user);
    }
}
